package cc.rengu.redp.bizimpl.upmp.service.impl;

import cc.rengu.redp.bizimpl.upmp.dao.UpmpBTradeAreaInfoMapper;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpBTradeAreaInfo;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpBTradeAreaInfo;
import cc.rengu.redp.bizimpl.upmp.service.IUpmpBTradeAreaInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author 刘玉亮.LL
 */
@Service
public class UpmpBTradeAreaInfoServiceImpl extends ServiceImpl<UpmpBTradeAreaInfoMapper, UpmpBTradeAreaInfo> implements IUpmpBTradeAreaInfoService {

    @Override
    public UpmpBTradeAreaInfo findOneByCode(String mchntarea, String status,String instId) {
        LambdaQueryWrapper<UpmpBTradeAreaInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UpmpBTradeAreaInfo::getTradeAreaCode, mchntarea);
        queryWrapper.eq(UpmpBTradeAreaInfo::getTradeAreaStatus, status);
        queryWrapper.eq(UpmpBTradeAreaInfo::getInstId, instId);
        return baseMapper.selectOne(queryWrapper);
    }
}
